/*
 * @Descripttion: 
 * @version: 
 * @Author: 
 * @Date: 2022-04-24 09:01:49
 * @LastEditors: weidelong
 * @LastEditTime: 2022-05-06 19:40:55
 */
const mongoose = require("./db")
const conn = mongoose.connection
conn.on("error", () => console.log("连接数据库失败"))

// 模型对象
const socialSchema  = mongoose.Schema({
  id: { type: String },
  userImg: { type: String }, // 用户头像
  userName: { type: String }, // 用户名称
  content: { type: String }, //内容
  fileUrl: { type: Array }, // 上传的图片资源等
  like: { type: String }, // 点赞
  pinglun: { type: Array }, // 评论列表
  addTime: { type: String } //创建时间
});

const social = mongoose.model("socials", socialSchema )
module.exports = social